package com.zttek.photosShareProject.modules.web.general;

import com.zttek.photosShareProject.modules.service.login.IUserService;
import com.zttek.photosShareProject.modules.service.login.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
public class shareRoute {
    @Autowired
    private IUserService userService;

    @RequestMapping(value = "share/personInfo", method = RequestMethod.GET)
    public String personInfo(Model model, HttpServletRequest request) {
        HttpSession session = request.getSession();
        if (session.getAttribute("currentUser") == null) {
            return "redirect:/login";
        }
        return null;
    }
    @RequestMapping(value = "share/edit", method = RequestMethod.GET)
    public String edit(Model model, HttpServletRequest request) {
        HttpSession session = request.getSession();
        if (session.getAttribute("currentUser") == null) {
            return "redirect:/login";
        }
        return null;
    }
    @RequestMapping(value = "share/rank", method = RequestMethod.GET)
    public String rank(Model model, HttpServletRequest request) {
        HttpSession session = request.getSession();
        if (session.getAttribute("currentUser") == null) {
            return "redirect:/login";
        }
        return null;
    }
    @RequestMapping(value = "share/search", method = RequestMethod.GET)
    public String search(Model model, HttpServletRequest request) {
        HttpSession session = request.getSession();
        if (session.getAttribute("currentUser") == null) {
            return "redirect:/login";
        }
        return null;
    }
    @RequestMapping(value = "share/search_share", method = RequestMethod.GET)
    public String search_share(Model model, HttpServletRequest request) {
        HttpSession session = request.getSession();
        if (session.getAttribute("currentUser") == null) {
            return "redirect:/login";
        }
        return null;
    }
    @RequestMapping(value = "share/search_person", method = RequestMethod.GET)
    public String search_person(Model model, HttpServletRequest request) {
        HttpSession session = request.getSession();
        if (session.getAttribute("currentUser") == null) {
            return "redirect:/login";
        }
        return null;
    }
    @RequestMapping(value = "share/oneShare", method = RequestMethod.GET)
    public String oneShare(Model model, HttpServletRequest request) {
        HttpSession session = request.getSession();
        if (session.getAttribute("currentUser") == null) {
            return "redirect:/login";
        }
        return null;
    }
}
